package Matches;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class demo5 {
    public static void main(String[] args) {
        String s = "来黑马程序员学习Java，\n" +
                "\n" +
                "手机号：18512516758,18512508907\n" +
                "\n" +
                "或者联系邮箱: boniu@itcast.cn,\n" +
                "\n" +
                "JAJLLiF: 01036517895, 010-98951256\n" +
                "\n" +
                "Щß/%: bozai@itcast. cn,\n" +
                "\n" +
                "HhhLif:400-618-9090 , 400-618-4000, 4006184000, 4006189090\n";
        String s1 = "(1[3-9]\\d{9})|(\\d+@[\\w&&[^_]]{2,6}(\\.[a-zA-Z]{2,3}){1,2})|(400-?[1-9]\\d{2}-?[1-9]\\d{3})";
        Pattern pattern = Pattern.compile(s1);
        Matcher matcher = pattern.matcher(s);
        while (matcher.find()){
            String s2 = matcher.group();
            System.out.println(s2);
        }
    }
}
